package Factoria;

public class FactoriaConductor implements Factoria{
	private String tipo;
	private double vdfl, gammaVdfl, gammaFr, gammaCC, vini;
	
	public FactoriaConductor(String ti){
		FactoriaLista lista = new FactoriaLista();
		if (!lista.listaTipoConductor().contains(ti)){
			throw new IllegalArgumentException("El tipo no existe. Debe ser: "+lista.listaTipoConductor());
		}
		double vd = 0;
		double gVdfl = 0;
		double gFr = 0;
		double gCC = 0;
		double vi = 0;
		
		if(ti == "Novel"){vd = 22.2; gVdfl = 0.5; gFr = 0.00036; gCC = 0.18; vi = 13.8;} //vdfl = 80 km/h | vini = 50km/h
		if(ti == "Principiante"){vd = 25; gVdfl = 0.35; gFr = 0.00032; gCC = 0.25; vi = 16.6;} //vdfl = 90 km/h | vini = 60km/h
		if(ti == "Medio"){vd = 27.7; gVdfl = 0.25; gFr = 0.00028; gCC = 0.25; vi = 19.4;} //vdfl = 100 km/h | vini = 70km/h
		if(ti == "Avanzado"){vd = 30.5; gVdfl = 0.2; gFr = 0.00024; gCC = 0.35; vi = 22.2;} //vdfl = 110 km/h | vini = 80km/h
		if(ti == "Experto"){vd = 33.3; gVdfl = 0.18; gFr = 0.0002; gCC = 0.5; vi = 25;} //vdfl = 120 km/h | vini = 90km/h
		vdfl = vd;
		tipo = ti;
		vini = vi;
		gammaVdfl = gVdfl;
		gammaFr = gFr;
		gammaCC = gCC;
	}
	
	public String getTipo(){
		return tipo;
	}
	public double getVelocidadDeFlujoLibre(){
		return vdfl;
	}
	
	public double getGammaVdfl(){
		return gammaVdfl;
	}
	
	public double getGammaFr(){
		return gammaFr;
	}
	
	public double getGammaCC(){
		return gammaCC;
	}
	public double getVelocidadInicial(){
		return vini;
	}
}